﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Zhaoxi.NET6.Interfaces;
using Zhaoxi.NET6.Models;

namespace Zhaoxi.NET6.Services
{
    /// <summary>
    /// 学员类实现
    /// </summary>
    public class StudentService : IStudentService
    {

        public async IAsyncEnumerable<Student> GetUserListAsync()
        {
            for (int i = 0; i < 50; i++)
            {
                await Task.Delay(10);
                yield return new Student()
                {
                    Id = i,
                    Name = $"学员-{i}",
                    Age = i,
                };
            }
        }

        public bool Validata(string nickname)
        {
            return nickname.Equals("金牌讲师Richard老师");
        }
    }
}